﻿using System;

public class Item
{
    static void Main(string[] args)
    {
        Random random = new Random();
        int randomNumber = random.Next(1, 101);
        System.Console.WriteLine("猜数字小游戏，请输入一个数字来猜测你是否能猜对");
        // Console.WriteLine(randomNumber);
        bool guessNumber = false;
        int Times = 0;
        while (!guessNumber && Times < 5)
        {
            string? input = Console.ReadLine();
            if (int.TryParse(input, out int userNumber))
            {
                Times++;
                if (userNumber == randomNumber)
                {

                    System.Console.WriteLine("猜对了");
                    guessNumber = true;
                }
                else if (userNumber < randomNumber)
                {
                    System.Console.WriteLine("小了孩子");
                }
                else
                {
                    System.Console.WriteLine("大了孩子");
                }
            }   else
        {
            System.Console.WriteLine("请输入数字");
        }
            
     

        }


        if (!guessNumber)
        {
            System.Console.WriteLine($"5五次都猜错了,正确数字是{randomNumber}");
        }
    }

}